<style>
    table.table-form-title{margin:20px auto 0;}
    table.table-form-title td{text-align: center;border-bottom:0 !important;}
    table.table{width:90%;margin:0 auto;}
    table.table-form-attach{margin-bottom:100px;}
</style>

<div style="margin:0 auto;">
    <table class="table-form-title table" style="margin-top:20px;">
        <tr>
            <td colspan="4" style="border-bottom: 0 !important;">
                <h2>${config.getKey("COMPANY_NAME")}</h2>
                <h2>${bpmTaskFrom.fromName}</h2>
            </td>
        </tr>
        <tr>
            <td width="15%"></td>
            <td width="45%"></td>
            <td width="15%"><span>编号：</span></td>
        </tr>
    </table>
    <table class="table-form-head table table-hover table-bordered">
        <tr>
            <th colspan="24" rowspan="1" style="background-color: rgb(221,239,255) ;text-align:  center">
                项目经理填写
            </th>
        </tr>
        <tr>
            <th colspan="3" rowspan="1">发起人</th>
            <td colspan="3" rowspan="1">
                <@f.tableselect readonly=true name="launchName" value="${bpmForm.launchName}" labelValue="${bpmForm.launchName}" boxTitle="用户信息" url="bpm/manager/list"
                keyId="name" keyName="name" checked=false
                tableInfo = "[{field:'username',title:'账号'},{field:'name',title:'姓名',query:
                true},{field:'compName',title:'归属公司'},
                {field:'deptName',title:'归属机构'},{field:'mobile',title:'手机号码'},
                {field:'status',title:'状态',dict:'sys_user_show_hide',query: true}]" placeholder="发起人" />
                <div id="c_tableselect2" class="panel-collapse collapse"></div>
            </td>
            <th colspan="3" rowspan="1">发起日期</th>
            <td colspan="3" rowspan="1">
                <@f.input readonly=true name="createTime" value="${bpmForm.createTime?string('yyyy-MM-dd')}" type="date" dataType="date" dataFormat="yyyy-MM-dd"
                placeholder="发起日期" butClass="fa fa-calendar-plus-o" required=true />
            </td>
            <th colspan="3" rowspan="1">项目档案编号</th>
            <td colspan="3" rowspan="1">
                <@f.tableselect readonly=true checked=false keyId="name" keyName="name" url="/bpm/project/list"
                name="projectId" value="${bpmForm.projectId}" labelValue="${bpmForm.projectId}" boxTitle="项目档案" tableInfo = "[{field:'name',title:'项目档案编号'},
                {field:'projectName',title:'项目名称'}, {field:'department',title:'项目所属部门'},{field:'ceoName',title:'项目经理'},
                {field:'contractFirst',title:'委托单位'},{field:'createTime',title:'创建时间'}]" placeholder="请选择项目档案编号" />
                <!--<@f.input name="projectDept" placeholder="请输入项目所属部门" required=true/>-->
            </td>
            <th colspan="3" rowspan="1">开票申请单编号</th>
            <td colspan="3" rowspan="1">
                <@f.input readonly=true name="invoiceId" value="${bpmForm.invoiceId}" placeholder="" required=true/>
            </td>
        </tr>
        <tr>
            <th colspan="3" rowspan="1">项目所属部门</th>
            <td colspan="3" rowspan="1">
                <@f.tableselect readonly=true checked=false keyId="department" keyName="department" url="/bpm/project/list"
                name="projectDept" value="${bpmForm.projectDept}" labelValue="${bpmForm.projectDept}" boxTitle="项目档案" tableInfo = "[{field:'name',title:'项目档案编号'},
                {field:'projectName',title:'项目名称'}, {field:'department',title:'项目所属部门'},{field:'ceoName',title:'项目经理'},
                {field:'contractFirst',title:'委托单位'},{field:'createTime',title:'创建时间'}]" placeholder="请选择项目档案编号" />
            </td>
            <th colspan="3" rowspan="1">项目经理</th>
            <td colspan="3" rowspan="1">
                <@f.tableselect readonly=true name="projectAdmin" value="${bpmForm.projectAdmin}" labelValue="${bpmForm.projectAdmin}" boxTitle="用户信息" url="bpm/manager/list"
                keyId="name" keyName="name" checked=false
                tableInfo = "[{field:'username',title:'账号'},{field:'name',title:'姓名',query:
                true},{field:'compName',title:'归属公司'},
                {field:'deptName',title:'归属机构'},{field:'mobile',title:'手机号码'},
                {field:'status',title:'状态',dict:'sys_user_show_hide',query: true}]" placeholder="项目经理" />
            </td>
            <th colspan="3" rowspan="1">三联单号</th>
            <td colspan="3" rowspan="1">
                <@f.input readonly=true name="sanlianId" value="${bpmForm.sanlianId}" placeholder="" required=true/>
            </td>
            <th colspan="3" rowspan="1">领票人</th>
            <td colspan="3" rowspan="1">
                <@f.tableselect readonly=true name="ledHolder" value="${bpmForm.ledHolder}" labelValue="${bpmForm.ledHolder}" boxTitle="用户信息" url="bpm/manager/list"
                keyId="name" keyName="name" checked=false
                tableInfo = "[{field:'username',title:'账号'},{field:'name',title:'姓名',query:
                true},{field:'compName',title:'归属公司'},
                {field:'deptName',title:'归属机构'},{field:'mobile',title:'手机号码'},
                {field:'status',title:'状态',dict:'sys_user_show_hide',query: true}]" placeholder="项目经理" />
            </td>
        </tr>
        <tr>
            <th colspan="3" rowspan="1">项目名称</th>
            <td colspan="9" rowspan="1">
                <@f.input readonly=true name="projectName" value="${bpmForm.projectName}" placeholder="" required=true/>
            </td>
            <th colspan="3" rowspan="1">委托单位</th>
            <td colspan="9" rowspan="1">
                <@f.input readonly=true name="entrustCompany" value="${bpmForm.entrustCompany}" placeholder="" required=true/>
            </td>
        </tr>

        <tr>
            <th colspan="3" rowspan="1">合同编号</th>
            <td colspan="3" rowspan="1">
                <@f.input readonly=true name="contractId" value="${bpmForm.contractId}" placeholder="" required=true/>
            </td>
            <th colspan="3" rowspan="1">合同甲方</th>
            <td colspan="9" rowspan="1">
                <@f.input readonly=true name="partA" value="${bpmForm.partA}" placeholder="" required=true/>
            </td>
            <th colspan="3" rowspan="1" style="color:red">应贴票金额</th>
            <td colspan="4" rowspan="1">
                <@f.input readonly=true name="ticketedMoney" value="${bpmForm.ticketedMoney}" placeholder="" required=true/>
            </td>
        </tr>

        <tr>
            <th colspan="3" rowspan="1">是否有合同附件</th>
            <td colspan="3" rowspan="1">
                <@f.select readonly=true name="containAttachment" value="${bpmForm.containAttachment}" dictType="sys_bpm_is_bid" blankValue="" blankLabel="项目状态"/>
            </td>
            <th colspan="3" rowspan="1">合同附件</th>
            <td colspan="15" rowspan="1">
                <input type="hidden" name="attachment" value="${bpmForm.attachment}"/>
                <!--<input type="hidden" name="bidedNoticeUrl" value="" />-->
                <input type="file" id="file" name="attachmentUrl" style="display:none;"/>
                <div class="pull-left">
                    <a target="_blank" name="bidedNoticeBox" href="${bpmForm.attachmentUrl}">${bpmForm.attachment}</a>
                </div>
                <div class="pull-right"><a onclick="showFileDlg();" href="javascript:void(0);"><i
                        class="fa icon-link"></i></a></div>
            </td>
        </tr>
        <tr>
            <th colspan="3" rowspan="1">发票类型</th>
            <td colspan="3" rowspan="1">
                <@f.select readonly=true name="invoiceType" value="${bpmForm.invoiceType}" dictType="sys_invoice_type" blankValue="" blankLabel="项目状态"/>
            </td>
            <th colspan="3" rowspan="1">项目内容</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="projectContent" value="${bpmForm.projectContent}" placeholder="" required=true/>
            </td>
            <th colspan="3" rowspan="1">发票金额（含税）</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="invoiceAmount" value="${bpmForm.invoiceAmount}" placeholder="" required=true/>
            </td>
        </tr>
        <tr>
            <th colspan="3" rowspan="7">开票信息</th>
            <th colspan="3" rowspan="1">单位名称</th>
            <td colspan="18" rowspan="1">
                <@f.input readonly=true name="company" value="${bpmForm.company}" placeholder="" required=true/>
            </td>
        </tr>

        <tr>
            <th colspan="3" rowspan="1">纳税人识别号</th>
            <td colspan="18" rowspan="1">
                <@f.input readonly=true name="identificationNumber" value="${bpmForm.identificationNumber}" placeholder="" required=true/>
            </td>
        </tr>

        <tr>
            <th colspan="3" rowspan="1">地址、电话</th>
            <td colspan="18" rowspan="1">
                <@f.input readonly=true name="addressAndPhone" value="${bpmForm.addressAndPhone}" placeholder="" required=true/>
            </td>
        </tr>

        <tr>
            <th colspan="3" rowspan="1">开户行及账号</th>
            <td colspan="18" rowspan="1">
                <@f.input readonly=true name="bankAndAccount" value="${bpmForm.bankAndAccount}" placeholder="" required=true/>
            </td>
        </tr>

        <tr>
            <th colspan="3" rowspan="3">备注</th>
            <th colspan="3" rowspan="1">工程名称</th>
            <td colspan="18" rowspan="1">
                <@f.input readonly=true name="projectTitle" value="${bpmForm.projectTitle}" placeholder="" required=true/>
            </td>

        </tr>
        <tr>
            <th colspan="3" rowspan="1">工程地址</th>
            <td colspan="18" rowspan="1">
                <@f.input readonly=true name="projectAddress" value="${bpmForm.projectAddress}" placeholder="" required=true/>
            </td>
        </tr>
        <tr>
            <td colspan="18" rowspan="1">工程名称：工程地址：</td>
        </tr>
        <tr>
            <th colspan="3" rowspan="2">备注</th>
            <td colspan="21" rowspan="1">
                <@f.input readonly=true name="remark" value="${bpmForm.remark}" placeholder="" required=true/>
            </td>
        </tr>
    </table>
    <table class="table-form-head table table-hover table-bordered">
        <tr>
            <th colspan="30" rowspan="1" style="background-color: rgb(221,239,255) ;text-align:  center">
                以下综合员填写
            </th>
        </tr>
        <tr>
            <th colspan="30" rowspan="1" style="text-align:  center">
                <h2>项目三联单</h2>
            </th>
        </tr>
        <tr>
            <th colspan="3" rowspan="1">三联单号</th>
            <td colspan="4" rowspan="1">
                <@f.input readonly=true name="sanlianId2" value="${bpmForm.sanlianId2}" placeholder="" required=true/>
            </td>
            <th colspan="3" rowspan="1">开具部门</th>
            <td colspan="6" rowspan="1">
                <@f.tableselect readonly=true checked=false keyId="department" keyName="department" url="/bpm/project/list"
                name="issueDepartment" value="${bpmForm.issueDepartment}" labelValue="${bpmForm.issueDepartment}"  boxTitle="项目档案" tableInfo = "[{field:'name',title:'项目档案编号'},
                {field:'projectName',title:'项目名称'}, {field:'department',title:'项目所属部门'},{field:'ceoName',title:'项目经理'},
                {field:'contractFirst',title:'委托单位'},{field:'createTime',title:'创建时间'}]" placeholder="请选择项目档案编号" />
            </td>
            <th colspan="3" rowspan="1">合同金额</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="contractMoney" value="${bpmForm.contractMoney}" placeholder="" required=true/>
            </td>
            <th colspan="2" rowspan="1">已开具金额</th>
            <td colspan="3" rowspan="1">
                <@f.input readonly=true name="amountIssued" value="${bpmForm.amountIssued}" placeholder="" required=true/>
            </td>
        </tr>

        <tr>
            <th colspan="30" rowspan="1" style="text-align:  center">
                <button name="btn-import" type="button" class="btn btn-primary btn-rounded btn-sm">刷新关联</button>
            </th>
        </tr>

        <tr>
            <th colspan="2" rowspan="1">工作方法</th>
            <th colspan="2" rowspan="1">工作量</th>
            <th colspan="2" rowspan="1">金额</th>
            <th colspan="2" rowspan="1">管理费比例</th>
            <th colspan="2" rowspan="1">管理费浮动比例</th>
            <th colspan="2" rowspan="1">管理费金额(计算)</th>
            <th colspan="2" rowspan="1">管理费金额(填写)</th>
            <th colspan="2" rowspan="1">仪器租金比例</th>
            <th colspan="2" rowspan="1">仪器租金</th>
            <th colspan="2" rowspan="1">材料费比例</th>
            <th colspan="2" rowspan="1">材料费</th>
            <th colspan="2" rowspan="1">报告审查费比例</th>
            <th colspan="2" rowspan="1">报告审查费</th>
            <th colspan="2" rowspan="1">税金比例</th>
            <th colspan="2" rowspan="1">税金</th>
        </tr>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="workWay" value="${bpmForm.workWay}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="workload" value="${bpmForm.workload}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="money" value="${bpmForm.money}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="managementFeeRate" value="${bpmForm.managementFeeRate}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="managementFeeFloatRate" value="${bpmForm.managementFeeFloatRate}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="managementFeeMoney" value="${bpmForm.managementFeeMoney}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="managementFeeMoneyPrint" value="${bpmForm.managementFeeMoneyPrint}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="rentRate" value="${bpmForm.rentRate}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="rent" value="${bpmForm.rent}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="materialRate" value="${bpmForm.materialRate}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="material" value="${bpmForm.material}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="reportRate" value="${bpmForm.reportRate}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="reportMoney" value="${bpmForm.reportMoney}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="taxRate" value="${bpmForm.taxRate}" placeholder="" required=true/></td>
        <td colspan="2" rowspan="1"><@f.input readonly=true name="tax" value="${bpmForm.tax}" placeholder="" required=true/></td>
        <tr>
            <th colspan="2" rowspan="1">合计</th>
            <td colspan="4" rowspan="1">
                <@f.input readonly=true name="total2" value="${bpmForm.tax}" placeholder="0.00" required=true/>
            </td>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="total3" value="${bpmForm.total3}" placeholder="0.00" required=true/>
            </td>
            <td colspan="2" rowspan="1">
                <@f.input readonly=true name="total4" value="${bpmForm.total4}" placeholder="0.00" required=true/>
            </td>
            <td colspan="4" rowspan="1">
                <@f.input readonly=true name="total5" value="${bpmForm.total5}" placeholder="0.00" required=true/>
            </td>
            <td colspan="4" rowspan="1">
                <@f.input readonly=true name="total6" value="${bpmForm.total6}" placeholder="0.00" required=true/>
            </td>
            <td colspan="4" rowspan="1">
                <@f.input readonly=true name="total7" value="${bpmForm.total7}" placeholder="0.00" required=true/>
            </td>
            <td colspan="4" rowspan="1">
                <@f.input readonly=true name="total8" value="${bpmForm.total8}" placeholder="0.00" required=true/>
            </td>
        </tr>
        <tr>
            <th colspan="4" rowspan="1">应缴款总计</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="totalContributionsDue" value="${bpmForm.totalContributionsDue}" placeholder="" required=true/>
            </td>
            <th colspan="4" rowspan="1">应贴发票金额</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="ticketedMoneyAmount" value="${bpmForm.ticketedMoneyAmount}" placeholder="" required=true/>
            </td>
            <th colspan="4" rowspan="1">三联单开具日期</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="sanlinaDate" value="${bpmForm.sanlinaDate?string('yyyy-MM-dd')}" type="date" dataType="date" dataFormat="yyyy-MM-dd"
                placeholder="发起日期" butClass="fa fa-calendar-plus-o" required=true />
            </td>
        </tr>
        <tr>
            <th colspan="5" rowspan="1">附件</th>
            <td colspan="25" rowspan="1">
                <input type="hidden" name="attachment2" value="${bpmForm.attachment2}"/>
                <!--<input type="hidden" name="bidedNoticeUrl" value="" />-->
                <input type="file" id="file2" name="attachmentUrl2" style="display:none;"/>
                <div class="pull-left">
                    <a target="_blank" name="bidedNoticeBox2" href="${bpmForm.attachmentUrl2}">${bpmForm.attachment2}</a>
                </div>
                <div class="pull-right"><a onclick="showFileDlg2();" href="javascript:void(0);"><i
                        class="fa icon-link"></i></a></div>
            </td>
        </tr>
        <tr>
            <th colspan="5" rowspan="1">备注</th>
            <td colspan="25" rowspan="1">
                <@f.input readonly=true name="remark2" value="${bpmForm.remark2}" placeholder="" required=true/>
            </td>
        </tr>



        <tr>
            <th colspan="30" rowspan="1" style="text-align:  center">
                <button name="btn-import" type="button" class="btn btn-primary btn-rounded btn-sm">成本票提供情况查询</button>
            </th>
        </tr>
        <tr>
            <th colspan="30" rowspan="1" style="text-align:  center">
                <h2>开发票登记表</h2>
            </th>
        </tr>
        <tr>
            <th colspan="4" rowspan="1">开票日期</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="dateOfInvoice" value="${bpmForm.dateOfInvoice?string('yyyy-MM-dd')}" type="date" dataType="date" dataFormat="yyyy-MM-dd"
                placeholder="发起日期" butClass="fa fa-calendar-plus-o" required=true />
            </td>
            <th colspan="4" rowspan="1">总额</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="invoiceMoneyAmount" value="${bpmForm.invoiceMoneyAmount}" placeholder="" required=true/>
            </td>
            <th colspan="4" rowspan="1">税率</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="invoiceRate" value="${bpmForm.invoiceRate}" placeholder="" required=true/>
            </td>
        </tr>
        <tr>
            <th colspan="4" rowspan="1">发票号码</th>
            <td colspan="16" rowspan="1">
                <@f.input readonly=true name="invoiceCode" value="${bpmForm.invoiceCode}" placeholder="" required=true/>
            </td>
            <th colspan="4" rowspan="1">领票日期</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="invoiceDate" value="${bpmForm.invoiceDate?string('yyyy-MM-dd')}" type="date" dataType="date" dataFormat="yyyy-MM-dd"
                placeholder="发起日期" butClass="fa fa-calendar-plus-o" required=true />
            </td>
        </tr>
        <tr>
            <th colspan="4" rowspan="1">不含税金额</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="noTaxMoney" value="${bpmForm.noTaxMoney}" placeholder="" required=true/>
            </td>
            <th colspan="4" rowspan="1">不含税其他</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="noTaxOther" value="${bpmForm.noTaxOther}" placeholder="" required=true/>
            </td>
            <th colspan="4" rowspan="1">不含税金额合计</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="noTaxAmount" value="${bpmForm.noTaxAmount}" placeholder="" required=true/>
            </td>
        </tr>
        <tr>
            <th colspan="4" rowspan="1">税额</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="taxMoney" value="${bpmForm.taxMoney}" placeholder="" required=true/>
            </td>
            <th colspan="4" rowspan="1">税额其他</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="taxOther" value="${bpmForm.taxOther}" placeholder="" required=true/>
            </td>
            <th colspan="4" rowspan="1">税额合计</th>
            <td colspan="6" rowspan="1">
                <@f.input readonly=true name="taxAmount" value="${bpmForm.taxAmount}" placeholder="" required=true/>
            </td>
        </tr>
        <tr>
            <th colspan="4" rowspan="1">总计</th>
            <td colspan="26" rowspan="1">
                <@f.input readonly=true name="invoiceTotal" value="${bpmForm.invoiceTotal}" placeholder="" required=true/>
            </td>
        </tr>
        <tr>
            <th colspan="4" rowspan="1">备注</th>
            <td colspan="26" rowspan="1">
                <@f.input readonly=true name="remark3" value="${bpmForm.remark3}" placeholder="" required=true/>
            </td>
        </tr>
        <tr>
            <th colspan="4" rowspan="1">处理意见</th>
            <td colspan="26" rowspan="1">
                <@f.input readonly=true name="opinion" value="${bpmForm.opinion}" placeholder="" required=true/>
            </td>
        </tr>
    </table>

</div>

<script type="text/javascript">
    function showFileDlg() {
        $("#file").click();
    }
    $("#file").change(function () {
        uploadBidedNotice();
    });
    function uploadBidedNotice() {
        var oFiles = document.getElementById("file").files;
        console.log(oFiles);
        var formdata = new FormData();
        formdata.append("file", oFiles[0]);
        opt.common.sendAjax({
            url: prefix + "/doUploadFile",
            data: formdata,
            type: "POST",
            processData: false,
            contentType: false,
            success: function (result) {
                console.log(result);
                if (result.status == 0) {
                    alert("请上传正确的word格式！！")
                } else {
                    $("input[name=attachment]").val(oFiles[0].name);
                    $("input[name=attachmentUrl]").attr("value", baseURL + result.url);
                    $("a[name=bidedNoticeBox]").html(oFiles[0].name).attr("href", baseURL + result.url);
                }
            }
        })
    }


    function showFileDlg2() {
        $("#file2").click();
    }
    $("#file2").change(function () {
        uploadBidedNotice2();
    });
    function uploadBidedNotice2() {
        var oFiles = document.getElementById("file2").files;
        console.log(oFiles);
        var formdata = new FormData();
        formdata.append("file", oFiles[0]);
        opt.common.sendAjax({
            url: prefix + "/doUploadFile2",
            data: formdata,
            type: "POST",
            processData: false,
            contentType: false,
            success: function (result) {
                console.log(result);
                if (result.status == 0) {
                    alert("请上传正确的word格式！！")
                } else {
                    $("input[name=attachment2]").val(oFiles[0].name);
                    $("input[name=attachmentUrl2]").attr("value", baseURL + result.url);
                    $("a[name=bidedNoticeBox2]").html(oFiles[0].name).attr("href", baseURL + result.url);
                }
            }
        })
    }


    function tableCallback(id, event, index, layero, nodes){
        console.log("aaaaaaaaaaaaaaa")
        if(id == "launchName"){
            console.log("弹出表格选择===>>>>: id:" + id + "  event:" + event + " index:" + index + "  layero:"+ layero + " nodes:" + JSON.stringify(nodes));
            console.log(nodes.table[0]);
            var data = nodes.table[0];
            console.log(data)

            console.log(data.ceoName);
            $("input[name=launchDepartment]").val(data.compName);
            //  $("input[name=projectName]").val(data.projectName);
            // // $("input[name=ceoName]").val(data.ceoName);
            //  $("input[name=projectAdmin]").val(data.ceoName);
            //  $("input[name=clientCompany]").val(data.contractFirst);
            //  $("input[name=projectDept]").val(data.department);
        }
    }


    $("button[name=btn-insert]").click(function () {
        var target = $(this).closest("table").find("tbody");
        var index = target.children().length + 1;
        var tpl = $(target.children().get(0)).prop("outerHTML");
        tpl = tpl.replaceAll("1", index);
        target.append(tpl);
    });
    $("button[name=btn-del]").click(function () {
        var target = $(this).closest("table").find("tbody");
        var index = target.children().length - 1;
        if(index>0){
            target.children().get(index).remove();
        }
    });
    $("button[name=btn-del-all]").click(function () {
        var target = $(this).closest("table").find("tbody");
        var index = target.children().length - 1;
        for(var i=index; i>0; i--){
            target.children().get(i).remove();
        }
    });
</script>